package edu.hnu.userserver.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import edu.hnu.commonutils.Result;
import edu.hnu.userserver.entity.ClientSalesperson;
import edu.hnu.userserver.service.ClientSalespersonService;
import edu.hnu.userserver.mapper.ClientSalespersonMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* @author 奥特曼
* @description 针对表【client_salesperson】的数据库操作Service实现
* @createDate 2023-07-28 17:06:25
*/
@Service
public class ClientSalespersonServiceImpl extends ServiceImpl<ClientSalespersonMapper, ClientSalesperson>
    implements ClientSalespersonService{
    @Autowired
  ClientSalespersonMapper clientSalespersonMapper;
   public Result getSalesperson(String ClientName){
       ClientSalesperson clientSalesperson = clientSalespersonMapper.selectById(ClientName);

       if(clientSalesperson==null){
           return  Result.error().data("找不到相应的salesperson");
       }
       else{
           return Result.ok().data(clientSalesperson.getClientName());
       }

    }
}




